package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /*
     * @Description  根据菜品id查询对应的套餐id
     * @Param [dishIds]
     * @return java.util.List<java.lang.Long>
     **/
    List<Long> getSetmealByDishId(List<Long> dishIds);

    /*
     * @Description  批量保存菜品和套餐的关系
     * @Param [setmealDishes]
     * @return void
     **/
    void insertBatch(List<SetmealDish> setmealDishes);

//    批量删除与套餐关联的菜品
    void deleteBySetmealIds(List<Long> setmealIds);

//    查询与套餐关联的菜品信息
    @Select("select * from setmeal_dish where setmeal_id=#{setmealId}")
    List<SetmealDish> getsetmealDishBySetmealId(Long setmealId);

//    删除与套餐关联的菜品
    @Delete("delete from setmeal_dish where setmeal_id=#{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
